package com.letoken.platform.pub.enums;

import org.apache.commons.lang3.ObjectUtils;

/**
 * 后台操作日志操作类型枚举
 *
 * @author : hfanghao
 * @date : 2022-01-20 16:11
 **/
public enum ShopStateEnum {
    IMPERFECT( "待完善",-1,""),
    IN_REVIEW("待审核", 0,"预计24小时内审核，请耐心等待！"),
    PASS("审核通过", 1,""),
    FAIL("审核被驳回", 2,"审核失败，请联系客服"),

    CANCELING("注销中", 3,"注销审核中"),

    LOG_OFF("已注销", 4,""),

    UNKNOWN("unknown", 99,"");

    private String name;
    private Integer code;
    private String alertMsg;

    public Integer getCode() {
        return code;
    }

    public String getAlertMsg() {
        return alertMsg;
    }

    ShopStateEnum(String name, Integer code, String alertMsg) {
        this.name = name;
        this.code = code;
        this.alertMsg = alertMsg;
    }


    public static ShopStateEnum  getInstance(Integer state) {
        if (ObjectUtils.isEmpty(state)) return UNKNOWN;
        for (ShopStateEnum sse : values()) {
            if (sse.code.equals(state)) {
                return sse;
            }
        }
        return UNKNOWN;
    }
}
